<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: Object Detection</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="header">
  <div class="summary">
<a href="#groups">Modules</a> |
<a href="#nested-classes">Classes</a> |
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Object Detection</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
<tr class="memitem:d9/d31/group__objdetect__c"><td align="right" class="memItemLeft" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d31/group__objdetect__c.html">C API</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/classcv_1_1BaseCascadeClassifier.html">cv::BaseCascadeClassifier</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/de5/classcv_1_1CascadeClassifier.html">cv::CascadeClassifier</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Cascade classifier class for object detection.  <a href="../../d1/de5/classcv_1_1CascadeClassifier.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/ddf/structcv_1_1DefaultDeleter_3_01CvHaarClassifierCascade_01_4.html">cv::DefaultDeleter&lt; CvHaarClassifierCascade &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/de9/classcv_1_1DetectionBasedTracker.html">cv::DetectionBasedTracker</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d34/structcv_1_1DetectionROI.html">cv::DetectionROI</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">struct for detection region of interest (ROI)  <a href="../../d3/d34/structcv_1_1DetectionROI.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d33/structcv_1_1HOGDescriptor.html">cv::HOGDescriptor</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Implementation of HOG (Histogram of Oriented Gradients) descriptor and object detector.  <a href="../../d5/d33/structcv_1_1HOGDescriptor.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/dc3/classcv_1_1QRCodeDetector.html">cv::QRCodeDetector</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d65/classcv_1_1SimilarRects.html">cv::SimilarRects</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga3489c40a2fb178c477302403ec5cc1db"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom">{ <br/>
  <a class="el" href="../../d5/d54/group__objdetect.html#gga3489c40a2fb178c477302403ec5cc1dba04a050084d81a4a05abe92b7fc9ef210">cv::CASCADE_DO_CANNY_PRUNING</a> = 1, 
<br/>
  <a class="el" href="../../d5/d54/group__objdetect.html#gga3489c40a2fb178c477302403ec5cc1dba1d35c5234686c05c075d224efc91d673">cv::CASCADE_SCALE_IMAGE</a> = 2, 
<br/>
  <a class="el" href="../../d5/d54/group__objdetect.html#gga3489c40a2fb178c477302403ec5cc1dba3ecc6a38e196bd80afb57ac7b116c7fc">cv::CASCADE_FIND_BIGGEST_OBJECT</a> = 4, 
<br/>
  <a class="el" href="../../d5/d54/group__objdetect.html#gga3489c40a2fb178c477302403ec5cc1dba54f9abc96125f942117c847bc8fa9b83">cv::CASCADE_DO_ROUGH_SEARCH</a> = 8
<br/>
 }</td></tr>
<tr class="separator:ga3489c40a2fb178c477302403ec5cc1db"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga9767823749e5e5df561593c2c85939cc"><td align="right" class="memItemLeft" valign="top"><a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../d6/dfb/classcv_1_1BaseCascadeClassifier_1_1MaskGenerator.html">BaseCascadeClassifier::MaskGenerator</a> &gt; </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d54/group__objdetect.html#ga9767823749e5e5df561593c2c85939cc">cv::createFaceDetectionMaskGenerator</a> ()</td></tr>
<tr class="separator:ga9767823749e5e5df561593c2c85939cc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga3dba897ade8aa8227edda66508e16ab9"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d54/group__objdetect.html#ga3dba897ade8aa8227edda66508e16ab9">cv::groupRectangles</a> (std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> &gt; &amp;rectList, int groupThreshold, double eps=0.2)</td></tr>
<tr class="memdesc:ga3dba897ade8aa8227edda66508e16ab9"><td class="mdescLeft"> </td><td class="mdescRight">Groups the object candidate rectangles.  <a href="../../d5/d54/group__objdetect.html#ga3dba897ade8aa8227edda66508e16ab9">More...</a><br/></td></tr>
<tr class="separator:ga3dba897ade8aa8227edda66508e16ab9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga1592d68e4c32a13aa50ed73dbecd6d22"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d54/group__objdetect.html#ga1592d68e4c32a13aa50ed73dbecd6d22">cv::groupRectangles</a> (std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> &gt; &amp;rectList, std::vector&lt; int &gt; &amp;weights, int groupThreshold, double eps=0.2)</td></tr>
<tr class="separator:ga1592d68e4c32a13aa50ed73dbecd6d22"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga371b207eb2113f7816e5857fa0d2e50e"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d54/group__objdetect.html#ga371b207eb2113f7816e5857fa0d2e50e">cv::groupRectangles</a> (std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> &gt; &amp;rectList, int groupThreshold, double eps, std::vector&lt; int &gt; *weights, std::vector&lt; double &gt; *levelWeights)</td></tr>
<tr class="separator:ga371b207eb2113f7816e5857fa0d2e50e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaca13a6339f9d8992d9ee278c6c8f53ae"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d54/group__objdetect.html#gaca13a6339f9d8992d9ee278c6c8f53ae">cv::groupRectangles</a> (std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> &gt; &amp;rectList, std::vector&lt; int &gt; &amp;rejectLevels, std::vector&lt; double &gt; &amp;levelWeights, int groupThreshold, double eps=0.2)</td></tr>
<tr class="separator:gaca13a6339f9d8992d9ee278c6c8f53ae"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga281baf622553e2eab17a8e96beab916d"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d54/group__objdetect.html#ga281baf622553e2eab17a8e96beab916d">cv::groupRectangles_meanshift</a> (std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> &gt; &amp;rectList, std::vector&lt; double &gt; &amp;foundWeights, std::vector&lt; double &gt; &amp;foundScales, double detectThreshold=0.0, <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> winDetSize=<a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a>(64, 128))</td></tr>
<tr class="separator:ga281baf622553e2eab17a8e96beab916d"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2>Haar Feature-based Cascade Classifier for Object Detection </h2>
<p>The object detector described below has been initially proposed by Paul Viola <a class="el" href="../../d0/de3/citelist.html#CITEREF_Viola01">[260]</a> and improved by Rainer Lienhart <a class="el" href="../../d0/de3/citelist.html#CITEREF_Lienhart02">[149]</a> .</p>
<p>First, a classifier (namely a <em>cascade of boosted classifiers working with haar-like features</em>) is trained with a few hundred sample views of a particular object (i.e., a face or a car), called positive examples, that are scaled to the same size (say, 20x20), and negative examples - arbitrary images of the same size.</p>
<p>After a classifier is trained, it can be applied to a region of interest (of the same size as used during the training) in an input image. The classifier outputs a "1" if the region is likely to show the object (i.e., face/car), and "0" otherwise. To search for the object in the whole image one can move the search window across the image and check every location using the classifier. The classifier is designed so that it can be easily "resized" in order to be able to find the objects of interest at different sizes, which is more efficient than resizing the image itself. So, to find an object of an unknown size in the image the scan procedure should be done several times at different scales.</p>
<p>The word "cascade" in the classifier name means that the resultant classifier consists of several simpler classifiers (<em>stages</em>) that are applied subsequently to a region of interest until at some stage the candidate is rejected or all the stages are passed. The word "boosted" means that the classifiers at every stage of the cascade are complex themselves and they are built out of basic classifiers using one of four different boosting techniques (weighted voting). Currently Discrete Adaboost, Real Adaboost, Gentle Adaboost and Logitboost are supported. The basic classifiers are decision-tree classifiers with at least 2 leaves. Haar-like features are the input to the basic classifiers, and are calculated as described below. The current algorithm uses the following Haar-like features:</p>
<div class="image">
<img alt="haarfeatures.png" src="../../haarfeatures.png"/>
<div class="caption">
image</div></div>
<p> The feature used in a particular classifier is specified by its shape (1a, 2b etc.), position within the region of interest and the scale (this scale is not the same as the scale used at the detection stage, though these two scales are multiplied). For example, in the case of the third line feature (2c) the response is calculated as the difference between the sum of image pixels under the rectangle covering the whole feature (including the two white stripes and the black stripe in the middle) and the sum of the image pixels under the black stripe multiplied by 3 in order to compensate for the differences in the size of areas. The sums of pixel values over a rectangular regions are calculated rapidly using integral images (see below and the integral description).</p>
<p>To see the object detector at work, have a look at the facedetect demo: <a href="https://github.com/opencv/opencv/tree/master/samples/cpp/dbt_face_detection.cpp">https://github.com/opencv/opencv/tree/master/samples/cpp/dbt_face_detection.cpp</a></p>
<p>The following reference is for the detection part only. There is a separate application called opencv_traincascade that can train a cascade of boosted classifiers from a set of samples.</p>
<dl class="section note"><dt>Note</dt><dd>In the new C++ interface it is also possible to use LBP (local binary pattern) features in addition to Haar-like features. .. [Viola01] Paul Viola and Michael J. Jones. Rapid Object Detection using a Boosted Cascade of Simple Features. IEEE CVPR, 2001. The paper is available online at <a href="http://research.microsoft.com/en-us/um/people/viola/Pubs/Detect/violaJones_CVPR2001.pdf">http://research.microsoft.com/en-us/um/people/viola/Pubs/Detect/violaJones_CVPR2001.pdf</a> </dd></dl>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga3489c40a2fb178c477302403ec5cc1db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3489c40a2fb178c477302403ec5cc1db">◆ </a></span>anonymous enum</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">anonymous enum</td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d8/da3/objdetect_8hpp.html">opencv2/objdetect.hpp</a>&gt;</code></p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga3489c40a2fb178c477302403ec5cc1dba04a050084d81a4a05abe92b7fc9ef210"></a>CASCADE_DO_CANNY_PRUNING <div class="python_language">Python: cv.CASCADE_DO_CANNY_PRUNING</div></td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="gga3489c40a2fb178c477302403ec5cc1dba1d35c5234686c05c075d224efc91d673"></a>CASCADE_SCALE_IMAGE <div class="python_language">Python: cv.CASCADE_SCALE_IMAGE</div></td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="gga3489c40a2fb178c477302403ec5cc1dba3ecc6a38e196bd80afb57ac7b116c7fc"></a>CASCADE_FIND_BIGGEST_OBJECT <div class="python_language">Python: cv.CASCADE_FIND_BIGGEST_OBJECT</div></td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="gga3489c40a2fb178c477302403ec5cc1dba54f9abc96125f942117c847bc8fa9b83"></a>CASCADE_DO_ROUGH_SEARCH <div class="python_language">Python: cv.CASCADE_DO_ROUGH_SEARCH</div></td><td class="fielddoc"></td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga9767823749e5e5df561593c2c85939cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9767823749e5e5df561593c2c85939cc">◆ </a></span>createFaceDetectionMaskGenerator()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt;<a class="el" href="../../d6/dfb/classcv_1_1BaseCascadeClassifier_1_1MaskGenerator.html">BaseCascadeClassifier::MaskGenerator</a>&gt; cv::createFaceDetectionMaskGenerator </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d8/da3/objdetect_8hpp.html">opencv2/objdetect.hpp</a>&gt;</code></p>
</div>
</div>
<a id="ga3dba897ade8aa8227edda66508e16ab9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3dba897ade8aa8227edda66508e16ab9">◆ </a></span>groupRectangles() <span class="overload">[1/4]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::groupRectangles </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> &gt; &amp; </td>
          <td class="paramname"><em>rectList</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>groupThreshold</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>eps</em> = <code>0.2</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>rectList, weights</td><td>=</td><td>cv.groupRectangles(</td><td class="paramname">rectList, groupThreshold[, eps]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d8/da3/objdetect_8hpp.html">opencv2/objdetect.hpp</a>&gt;</code></p>
<p>Groups the object candidate rectangles. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rectList</td><td>Input/output vector of rectangles. Output vector includes retained and grouped rectangles. (The Python list is not modified in place.) </td></tr>
    <tr><td class="paramname">groupThreshold</td><td>Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it. </td></tr>
    <tr><td class="paramname">eps</td><td>Relative difference between sides of the rectangles to merge them into a group.</td></tr>
  </table>
  </dd>
</dl>
<p>The function is a wrapper for the generic function partition . It clusters all the input rectangles using the rectangle equivalence criteria that combines rectangles with similar sizes and similar locations. The similarity is defined by eps. When eps=0 , no clustering is done at all. If \(\texttt{eps}\rightarrow +\inf\) , all the rectangles are put in one cluster. Then, the small clusters containing less than or equal to groupThreshold rectangles are rejected. In each other cluster, the average rectangle is computed and put into the output rectangle list. </p>
</div>
</div>
<a id="ga1592d68e4c32a13aa50ed73dbecd6d22"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1592d68e4c32a13aa50ed73dbecd6d22">◆ </a></span>groupRectangles() <span class="overload">[2/4]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::groupRectangles </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> &gt; &amp; </td>
          <td class="paramname"><em>rectList</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; int &gt; &amp; </td>
          <td class="paramname"><em>weights</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>groupThreshold</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>eps</em> = <code>0.2</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>rectList, weights</td><td>=</td><td>cv.groupRectangles(</td><td class="paramname">rectList, groupThreshold[, eps]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d8/da3/objdetect_8hpp.html">opencv2/objdetect.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a id="ga371b207eb2113f7816e5857fa0d2e50e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga371b207eb2113f7816e5857fa0d2e50e">◆ </a></span>groupRectangles() <span class="overload">[3/4]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::groupRectangles </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> &gt; &amp; </td>
          <td class="paramname"><em>rectList</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>groupThreshold</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>eps</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; int &gt; * </td>
          <td class="paramname"><em>weights</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; double &gt; * </td>
          <td class="paramname"><em>levelWeights</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>rectList, weights</td><td>=</td><td>cv.groupRectangles(</td><td class="paramname">rectList, groupThreshold[, eps]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d8/da3/objdetect_8hpp.html">opencv2/objdetect.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a id="gaca13a6339f9d8992d9ee278c6c8f53ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaca13a6339f9d8992d9ee278c6c8f53ae">◆ </a></span>groupRectangles() <span class="overload">[4/4]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::groupRectangles </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> &gt; &amp; </td>
          <td class="paramname"><em>rectList</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; int &gt; &amp; </td>
          <td class="paramname"><em>rejectLevels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; double &gt; &amp; </td>
          <td class="paramname"><em>levelWeights</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>groupThreshold</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>eps</em> = <code>0.2</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>rectList, weights</td><td>=</td><td>cv.groupRectangles(</td><td class="paramname">rectList, groupThreshold[, eps]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d8/da3/objdetect_8hpp.html">opencv2/objdetect.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a id="ga281baf622553e2eab17a8e96beab916d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga281baf622553e2eab17a8e96beab916d">◆ </a></span>groupRectangles_meanshift()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::groupRectangles_meanshift </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> &gt; &amp; </td>
          <td class="paramname"><em>rectList</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; double &gt; &amp; </td>
          <td class="paramname"><em>foundWeights</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; double &gt; &amp; </td>
          <td class="paramname"><em>foundScales</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>detectThreshold</em> = <code>0.0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> </td>
          <td class="paramname"><em>winDetSize</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a>(64, 128)</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d8/da3/objdetect_8hpp.html">opencv2/objdetect.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:41 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
